package com.kymatrix.mpo.plus.bpm.server.model.form.process;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
import lombok.experimental.Accessors;

@ApiModel(value = "管理后台 - 流程定义 Response")
@Data
@Accessors(chain=true)
public class QueryBpmProcessDefinitionResp {

    @ApiModelProperty(value = "编号", example = "1024")
    private String id;

    @ApiModelProperty(value = "版本", example = "1")
    private Integer version;

    @ApiModelProperty(value = "流程名称", example = "zhangsan")
    private String name;

    @ApiModelProperty(value = "流程标识", example = "yudao")
    private String key;

    @ApiModelProperty(value = "流程图标", example = "https://www.iocoder.cn/yudao.jpg")
    private String icon;

    @ApiModelProperty(value = "流程描述", example = "我是描述")
    private String description;

    @ApiModelProperty(value = "流程分类", example = "1")
    private String category;
    @ApiModelProperty(value = "流程分类名字", example = "请假")
    private String categoryName;

    @ApiModelProperty(value = "表单类型-参见 bpm_model_form_type 数据字典", example = "1")
    private Integer formType;
    @ApiModelProperty(value = "表单编号-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时，必须非空", example = "1024")
    private String formId;
    @ApiModelProperty(value = "表单名字", example = "请假表单")
    private String formName;
    @ApiModelProperty(value = "表单的配置-JSON 字符串。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时，必须非空")
    private String formConf;
    @ApiModelProperty(value = "表单项的数组-JSON 字符串的数组。在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时，必须非空")
    private List<String> formFields;
    @ApiModelProperty(value = "自定义表单的提交路径，使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时，必须非空",
            example = "/bpm/oa/leave/create")
    private String formCustomCreatePath;
    @ApiModelProperty(value = "自定义表单的查看路径，使用 Vue 的路由地址-在表单类型为 {@link BpmModelFormTypeEnum#CUSTOM} 时，必须非空",
            example = "/bpm/oa/leave/view")
    private String formCustomViewPath;

    @ApiModelProperty(value = "中断状态-参见 SuspensionState 枚举", example = "1")
    private Integer suspensionState; // 参见 SuspensionState 枚举

    @ApiModelProperty(value = "部署时间")
    private LocalDateTime deploymentTime; // 需要从对应的 Deployment 读取，非必须返回

    @ApiModelProperty(value = "BPMN XML")
    private String bpmnXml; // 需要从对应的 BpmnModel 读取，非必须返回

    @ApiModelProperty(value = "发起用户需要选择审批人的任务数组")
    private List<UserTask> startUserSelectTasks; // 需要从对应的 BpmnModel 读取，非必须返回

    @ApiModel(value = "BPMN UserTask 用户任务")
    @Data
@Accessors(chain=true)
    public static class UserTask {

        @ApiModelProperty(value = "任务标识", example = "sudo")
        private String id;

        @ApiModelProperty(value = "任务名", example = "王五")
        private String name;

    }

}
